libostree: Fix crash if output is not a tty
authorColin Walters <walters@verbum.org>
Sat, 15 Mar 2014 01:59:35 +0000 (21:59 -0400)
committerColin Walters <walters@verbum.org>
Sat, 15 Mar 2014 01:59:36 +0000 (21:59 -0400)
This was a recent regression.

src/libostree/ostree-repo-pull.c

index 6776a2ae7ec194bf14102703c5d53215f7394d12..194c4ade2a65b2f160090269b5b55de628dc1d88 100644 (file)
@@ -1245,7 +1245,10 @@ ostree_repo_pull (OstreeRepo               *self,
                              (guint64)(bytes_transferred / shift),
                              shift == 1 ? "B" : "KiB",
                              (guint) ((end_time - start_time) / G_USEC_PER_SEC));
-      ostree_async_progress_set_status (pull_data->progress, msg);
+      if (pull_data->progress)
+        ostree_async_progress_set_status (pull_data->progress, msg);
+      else
+        g_print ("%s\n", msg);
     }
 
   ret = TRUE;